1. Field of the Invention
The present invention relates to an axisymmetric figure shaping device for shaping an input figure which has a form approximately symmetric with respect to a predetermined axis of symmetry so as to be precisely symmetric with respect to the axis of symmetry.
2. Description of the Related Art
Devices which process image data using a computer, such as a CAD system and graphics software to run on a personal computer, are in general provided with a function of shaping an input figure which is approximately symmetrical with respect to a predetermined reference line (axis of symmetry) so as to be precisely symmetrical with respect to the reference line as the axis of symmetry.
One of conventional figure shaping techniques of this kind for shaping axisymmetric figures is disclosed, for example, in Japanese Patent Laying-Open (Kokai) No. Showa 62-111369. The technique recited in this literature is employed for automatically reading a design drawing to recognize a descriptive symbol illustrated in the drawing. FIG. 26 shows structure of the figure shaping device recited in the literature. As illustrated in the figure, the figure shaping device according to the conventional technique includes a recognition processing unit 101, a symbol table 102 and a symmetric transformation unit 103. The recognition processing unit 101 includes a symmetric form decision unit 111 and a comparison circuit 112.
FIG. 27 is a flow chart showing a flow of processing by the figure shaping device of FIG. 26. With reference to the figure, first, input image to be recognized is applied to the recognition processing unit 101. The recognition processing unit 101 outputs a recognition result (a) of the input figure (FIG. 27, Steps 2601 and 2602).
Next, the symmetric form decision unit 111 refers to the symbol table 102 in which classification of symmetric and asymmetric symbols is defined to decide whether the image based on the recognition result (a) corresponds to a symmetric symbol or not (Step 2603). Here, that image corresponds to a specific symbol indicates that a symbol exists which is approximate to the form of the image among symbols stored in the symbol table 102. When a decision is made that the input image corresponds to a symbol which is not symmetric, the recognition result (a) is output as an ultimate recognition result (Step 2610).
On the other hand, when a decision is made that the image corresponds to a symmetric symbol, the symmetric transformation unit 103 conducts symmetric transformation with respect to the input image (Step 2604). Then, with respect to the image subjected to symmetric transformation, the recognition processing unit 101 again conducts recognition processing, whereby a recognition result (b) is obtained as a result of the processing (Steps 2605 and 2606).
Next, the comparison circuit 112 compares the recognition result (a) with the recognition result (b). When the two recognition results (a) and (b) coincide with each other, the recognition result (a) is output as an ultimate result (Steps 2607 and 2608). When the recognition results (a) and (b) fail to coincide with each other, processing is completed because of impossibility of symmetry decision (Steps 2607 and 2609).
Another conventional figure shaping technique for shaping an axisymmetric figure is disclosed, for example, in Japanese Patent Laying Open (Kokai) No. Showa 63-261481. The technique recited in the literature is employed for recognizing a drawing made based on the broad notation and supplementing the drawing with a dimension etc. which is not illustrated in the drawing based on the illustrated contents of the drawing. FIG. 28 shows structure of the figure shaping device recited in the literature. As illustrated in the figure, the figure shaping device according to the conventional technique includes a figure recognition device 201, a candidate symmetric line segment extracting means 202, a vertical line segment setting means 203, an operation means 204 and a drawing information setting means 205. The figure recognition device 201 includes a read processing unit 211, an image data storage unit 212, a vector processing unit 213, a vector classification processing unit 214, a symbol recognition processing unit 215, a line segment identification unit 216, a character recognition processing unit 217 and a recognition result storage unit 218.
FIG. 29 is a flow chart showing a flow of processing by the figure shaping device of FIG. 28. FIG. 30 is a diagram for use in explaining a method of deciding about symmetry of a shape line intersecting with a central line. With reference to these figures, first in the figure recognition device 201, a figure applied through the read processing unit 211 is stored in the image data storage unit 212. The vector processing unit 213 conducts polygonal approximation with respect to the image data stored in the image data storage unit 212 to convert the data into vector data and supplies the data to the vector classification processing unit 214.
The vector classification processing unit 214 classifies the applied vector data into symbols, line segments and characters and supplies them to the symbol recognition processing unit 215, the line segment identification processing unit 216 and the character recognition processing unit 217, respectively. The line segment identification processing unit 216 classifies vector data indicative of applied line segments into shape lines, central lines, etc. and stores them in the recognition result storage unit 218. The symbol recognition processing unit 215 and the character recognition processing unit 217 identify applied characters and symbols, respectively, attach attributes to the characters and symbols based on the identification results and store them in the recognition result storage unit 218 (Step 2801).
Next, the candidate symmetric line segment extracting means 202 extracts central lines which have a possibility of being symmetric from the recognition result storage unit 218 and counts the number of the central lines (Step 2802), and with respect to each of the extracted central lines, checks existence/non-existence of a shape line intersecting with the central line or an isolated shape line (Step 2803). If there exists a central line intersecting with a shape line or a central line having an isolated form at its opposite ends, the vertical line segment setting means 203 and the operation means 204 identify symmetry of the shape line or that of the isolated form.
Description will be here made of a symmetry decision method with reference to FIG. 30. The vertical line segment setting means 203, for example, drops a perpendicular L2 from an end point P2 of the vector to a central line b and the operation means 204 obtains a distance l2 between the end point P2 and the central line b. The unit further obtains a distance m2 between a point of intersection x2 on the vector c intersecting with an extended line of the perpendicular L2 and the central line b. Then, a difference between these two distances l2 and m2 is calculated to see if the difference satisfies the following expression with respect to a predetermined threshold value (.DELTA.1/2). EQU .vertline.l2-m2.vertline.&lt;A1/2 (1)
The same calculation will be made with respect to other end points. Then, when the expression (1) holds for all the end points and a sum of the respective differences of distance satisfies the following expression with respect to a predetermined threshold value Q: EQU .SIGMA..vertline.ln-mn.vertline.&lt;Q (2)
determination is made that the shape line is symmetric with respect to the central line b (Step 2805).
After symmetry decision is made with respect to all the central lines, the drawing information setting means 205 sets omitted drawing information based on part of the drawing information indicated at the shape line having symmetry (Step 2807).
The above-described conventional figure shaping devices have the following shortcomings.
The first conventional figure shaping device which makes a decision with reference to a symbol table has a drawback that when a symmetric figure which is not defined in the symbol table is applied, the device is incapable of identifying the figure as a symmetric figure. The reason is that for confirming whether an input figure corresponds to a symbol stored in the symbol table in the course of processing, all figures to be identified as symmetric figures should be defined in the symbol table.
The second conventional axisymmetric figure shaping device which shapes a figure with respect to a central line has a drawback that a user should make a drawing with an axis of symmetry in mind, which makes figure input work laborious. The reason is that the user needs to shape a figure while recognizing, as an axis of symmetry, only a central line drawn in advance as a kind of line indicative of a central line.
Other than the above-described conventional art, also proposed is a technique for automatically setting an axis of symmetry for an input figure and shaping the input figure so as to be precisely symmetric with respect to the axis of symmetry. This is, however, a shaping technique mainly for linear figures and is therefore incapable of effectively shaping an input figure which includes a curve.